home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
pcl_src.zoo
/
defsys.lsp
< prev
next >
Wrap
Lisp/Scheme
|
1993-02-07
|
36KB
|
898 lines
;;;-*-Mode:LISP; Package:(PCL LISP ); Base:10; Syntax:Common-lisp -*-
;;;
;;; *************************************************************************
;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation.
;;; All rights reserved.
;;;
;;; Use and copying of this software and preparation of derivative works
;;; based upon this software are permitted. Any distribution of this
;;; software or derivative works must comply with all applicable United
;;; States export control laws.
;;;
;;; This software is made available AS IS, and Xerox Corporation makes no
;;; warranty about the software, its performance or its conformity to any
;;; specification.
;;;
;;; Any person obtaining a copy of this software is requested to send their
;;; name and post office or electronic mail address to:
;;; CommonLoops Coordinator
;;; Xerox PARC
;;; 3333 Coyote Hill Rd.
;;; Palo Alto, CA 94304
;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
;;;
;;; Suggestions, comments and requests for improvements are also welcome.
;;; *************************************************************************
;;;
;;; Some support stuff for compiling and loading PCL. It would be nice if
;;; there was some portable make-system we could all agree to share for a
;;; while. At least until people really get databases and stuff.
;;;
;;; *** ***
;;; *** DIRECTIONS FOR INSTALLING PCL AT YOUR SITE ***
;;; *** ***
;;;
;;; To get PCL working at your site you should:
;;;
;;; - Get all the PCL source files from Xerox. The complete list of source
;;; file names can be found in the defsystem for PCL which appears towards
;;; the end of this file.
;;;
;;; - Edit the variable *pcl-directory* below to specify the directory at
;;; your site where the pcl sources and binaries will be. This variable
;;; can be found by searching from this point for the string "***" in
;;; this file.
;;;
;;; - Use the function (pcl::compile-pcl) to compile PCL for your site.
;;;
;;; - Once PCL has been compiled it can be loaded with (pcl::load-pcl).
;;; Note that PCL cannot be loaded on top of itself, nor can it be
;;; loaded into the same world it was compiled in.
;;;
#+pcl
(when (boundp 'pcl::*boot-state*)
(warn "Lisp heap already had PCL package. Renaming it to OLD-PCL.")
(rename-package "PCL" "OLD-PCL"))
(in-package "PCL" :use (list (or (find-package :walker)
(make-package :walker :use '(:lisp)))
(or (find-package :iterate)
(make-package :iterate
:use '(:lisp :walker)))
(find-package :lisp)))
(export (intern (symbol-name :iterate) ;Have to do this here,
(find-package :iterate)) ;because in the defsystem
(find-package :iterate)) ;(later in this file)
;we use the symbol iterate
;to name the file
;;;
;;; Sure, its weird for this to be here, but in order to follow the rules
;;; about order of export and all that stuff, we can't put it in PKG before
;;; we want to use it.
;;;
(defvar *the-pcl-package* (find-package :pcl))
(defvar *pcl-system-date* "July 92 PCL (1b)")
#+cmu
(when (boundp 'ext::*herald-items*)
(setf (getf ext::*herald-items* :pcl)
`(" CLOS based on PCL version: " ,*pcl-system-date*)))
;;;
;;; Various hacks to get people's *features* into better shape.
;;;
(eval-when (compile load eval)
#+(and Symbolics Lispm)
(multiple-value-bind (major minor) (sct:get-release-version)
(etypecase minor
(integer)
(string (setf minor (parse-integer minor :junk-allowed t))))
(pushnew :genera *features*)
(ecase major
((6)
(pushnew :genera-release-6 *features*))
((7)
(pushnew :genera-release-7 *features*)
(ecase minor
((0 1) (pushnew :genera-release-7-1 *features*))
((2) (pushnew :genera-release-7-2 *features*))
((3) (pushnew :genera-release-7-3 *features*))
((4) (pushnew :genera-release-7-4 *features*))))
((8)
(pushnew :genera-release-8 *features*)
(ecase minor
((0) (pushnew :genera-release-8-0 *features*))
((1) (pushnew :genera-release-8-1 *features*))))))
#+CLOE-Runtime
(let ((version (lisp-implementation-version)))
(when (string-equal version "2.0" :end1 (min 3 (length version)))
(pushnew :cloe-release-2 *features*)))
(dolist (feature *features*)
(when (and (symbolp feature) ;3600!!
(equal (symbol-name feature) "CMU"))
(pushnew :CMU *features*)))
#+TI
(if (eq (si:local-binary-file-type) :xld)
(pushnew ':ti-release-3 *features*)
(pushnew ':ti-release-2 *features*))
#+Lucid
(when (search "IBM RT PC" (machine-type))
(pushnew :ibm-rt-pc *features*))
#+ExCL
(cond ((search "sun3" (lisp-implementation-version))
(push :sun3 *features*))
((search "sun4" (lisp-implementation-version))
(push :sun4 *features*)))
#+(and HP Lucid)
(push :HP-Lucid *features*)
#+(and HP (not Lucid) (not excl))
(push :HP-HPLabs *features*)
#+Xerox
(case il:makesysname
(:lyric (push :Xerox-Lyric *features*))
(otherwise (push :Xerox-Medley *features*)))
;;;
;;; For KCL and IBCL, push the symbol :turbo-closure on the list *features*
;;; if you have installed turbo-closure patch. See the file kcl-mods.text
;;; for details.
;;;
;;; The xkcl version of KCL has this fixed already.
;;;
#+xkcl(pushnew :turbo-closure *features*)
)
;;; Yet Another Sort Of General System Facility and friends.
;;;
;;; The entry points are defsystem and operate-on-system. defsystem is used
;;; to define a new system and the files with their load/compile constraints.
;;; Operate-on-system is used to operate on a system defined that has been
;;; defined by defsystem. For example:
#||
(defsystem my-very-own-system
"/usr/myname/lisp/"
((classes (precom) () ())
(methods (precom classes) (classes) ())
(precom () (classes methods) (classes methods))))
This defsystem should be read as follows:
* Define a system named MY-VERY-OWN-SYSTEM, the sources and binaries
should be in the directory "/usr/me/lisp/". There are three files
in the system, there are named classes, methods and precom. (The
extension the filenames have depends on the lisp you are running in.)
* For the first file, classes, the (precom) in the line means that
the file precom should be loaded before this file is loaded. The
first () means that no other files need to be loaded before this
file is compiled. The second () means that changes in other files
don't force this file to be recompiled.
* For the second file, methods, the (precom classes) means that both
of the files precom and classes must be loaded before this file
can be loaded. The (classes) means that the file classes must be
loaded before this file can be compiled. The () means that changes
in other files don't force this file to be recompiled.
* For the third file, precom, the first () means that no other files
need to be loaded before this file is loaded. The first use of
(classes methods) means that both classes and methods must be
loaded before this file can be compiled. The second use of (classes
methods) mean that whenever either classes or methods changes precom
must be recompiled.
Then you can compile your system with:
(operate-on-system 'my-very-own-system :compile)
and load your system with:
(operate-on-system 'my-very-own-system :load)
||#
;;;
(defvar *system-directory*)
;;;
;;; *port* is a list of symbols (in the PCL package) which represent the
;;; Common Lisp in which we are now running. Many of the facilities in
;;; defsys use the value of *port* rather than #+ and #- to conditionalize
;;; the way they work.
;;;
(defvar *port*
'(#+Genera Genera
;